<!--{include header}-->

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="forum">
	<div class="dashboard" id="dashboard">
		<ul>${current_forum(null)}</ul>
	</div>
    <div id="content" class="coupons-box clear">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>{$topic['title']}</h2>
					<ul class="filter"><li><a href="#reply">Responder</a></li></ul>
				</div>
                <div class="sect">
				<table id="replies-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr>
					<td width="48" valign="top"><div class="avatar"><img src="${user_image($users[$topic['user_id']]['avatar'])}" width="48" height="48" /></div></td>
					<td width="660">
						<div class="author">
							<span style="float:right;">${Utility::HumanTime($topic['create_time'])}</span><b>{$users[$topic['user_id']]['username']}</b><div class="clear"></div>
						</div>
						<div class="topic-content">
							${nl2br($topic['content'])}
						</div>
					</td>
					</tr>
					<!--{loop $replies $one}-->
					<tr>
					<td width="48" valign="top">
						<div class="avatar"><img src="${user_image($users[$one['user_id']]['avatar'])}" width="48" height="48" /></div>
					</td>
					<td width="660">
						<div class="author">
							<span style="float:right;">${Utility::HumanTime($one['create_time'])}</span><b>{$users[$one['user_id']]['username']}</b><div class="clear"></div>
						</div>
						<div class="topic-content">
							${nl2br($one['content'])}
						</div>
					</td>
					</tr>
					<!--{/loop}-->
					<tr><td colspan="2">{$pagestring}</td></tr>
				</table>	
				</div>
				<div class="head" id="reply">
					<h2>Eu quero responder</h2>
				</div>
				<div class="sect consult-form">
					<!--{if is_login()}-->
                    <form id="forum-reply-form" method="post" action="/forum/topic.php?id={$topic['id']}">
					<input type="hidden" name="parent_id" value="{$topic['id']}" />
					<textarea cols="60" rows="5" name="content" id="forum-new-content" class="f-textarea"></textarea>
					<p class="commit"><input type="submit" value="Postar" name="commit" id="leader-submit" class="formbutton"/></p>
					</form>
					<!--{else}-->
					Por favor faça <a href="/account/login.php?r={$currefer}">Login</a> ou <a href="/account/signup.php">Registre-se</a>.
					<!--{/if}-->
					<div class="clear"></div>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
    <div id="sidebar">
		<!--{include block_side_subscribe}-->
    </div>
</div>

</div> <!-- bd end -->
</div> <!-- bdw end -->

<!--{include footer}-->
